<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page pageEncoding="UTF-8"%>
<%@page import="com.zhixiang.core.util.AppUtil"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
	<head>
		<title>安全生产管理系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	    <meta http-equiv="X-UA-Compatible" content="IE=IE8,chrome=1"/>
	    <meta name="description" content=""/>
	    <meta name="keywords" content=""/>
	    <link rel="shortcut icon" href="<%=request.getContextPath()%>/resources/images/system/favicon.ico"/>
	    <link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/login.css"/>
	    
		<%-- <%
		response.addHeader("__timeout","true");
		String codeEnabled=(String)AppUtil.getSysConfig().get("codeConfig");
		String dyPwdEnabled = (String)AppUtil.getSysConfig().get("dynamicPwd");
		if(StringUtils.isEmpty(codeEnabled)){//若当前数据库没有配置验证码参数
			codeEnabled="close";//代表需要输入
		}
		if(StringUtils.isEmpty(dyPwdEnabled)){//若当前数据库没有配置动态密码参数
			dyPwdEnabled="close";//代表需要输入
		}
		%> --%>
		<script type="text/javascript">
			var __ctxPath="<%=request.getContextPath() %>";
			//var __attachFilesPath="file:///D:/attachFiles";			
			var __loginImage=__ctxPath+"<%=AppUtil.getCompanyLogoGif()%>";
		</script>
<%-- 		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/ext3/adapter/ext/ext-base.gzjs"></script> --%>
<%-- 		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/ext3/ext-all.gzjs"></script> --%>
<%-- 		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/ext3/ext-lang-zh_CN.js"></script> --%>
<%-- 		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/App.LoginWin.js"></script> --%>
		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/login/libs/jquery-1.8.3.min.js"></script>
	    <script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/login/libs/jquery.validate.min.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/login/Particleground.js"></script>
	    <script type="text/javascript">
	    (function($){
	        $.fn.overlabel = function() {
	            this.each(function() {
	                var $placeholder = $(this),
	                    $input = $('#' + $placeholder.attr('for'));
	
	                $placeholder
	                    .addClass('overlabel')
	                    .bind('click', function(event) {
	                        $input.focus();
	                    });
	
	                $input
	                    .bind('focus blur', function(event) {
	                        $placeholder.css('display', (event.type == 'blur' && !$input.val() ? '' : 'none'));
	                    }).trigger('blur');
	            });
	        };
	    })(jQuery);
	        $(document).ready(function() {
	               //粒子背景特效
                $('body').particleground({
                  dotColor: '#9D95BB',//'#5cbdaa',
                  lineColor: '#9D95BB'
                });
                
	            $('#loginform').find('.placeholder').overlabel();
	            $("#loginform").validate({
	                rules: {
	                    username: {
	                        required: true,
	                        minlength: 1
	                    },
	                    password:{
	                        required: true,
	                        minlength: 1
	                    }
	                },
	                messages: {
	                    username: {
	                        required: "用户名不能为空！",
	                        minlength: "用户名不能少于1位！"
	                    },
	                    password: {
	                        required: "密码不能为空！",
	                        minlength: "密码不能少于1位！"
	                    }
	                },
	                errorPlacement: function(error, element) {
	                    if (element.is(":radio"))
	                        error.appendTo(element.parent());
	                    else if (element.is(":checkbox"))
	                        error.appendTo(element.parent());
	                    else
	                        error.appendTo(element.parent());
	                },
	                submitHandler: function() {
	                    
	                    var url = '<%=request.getContextPath()%>/login.do';   
	                     //获取表单值，并以json的数据形式保存到params中   
			            var params = {   
			                username:$("#username").val(),   
			                password:$("#password").val(),
			                _spring_security_remember_me:$("#_spring_security_remember_me").val()
			            };   
			            //使用$.post方式    
			            $.post( 
			            	url,        //服务器要接受的url                      
                			params,     //传递的参数   
                			function(json){ //服务器返回后执行的函数 参数 data保存的就是服务器发送到客户端的数据   
// 			                   var returnval = eval("("+json+")");    //包数据解析为json 格式		
			                   if(json.success){
			                  	 window.location.href = __ctxPath + "/index.jsp";
			                   }else{
			                   		$("#msgdiv").css({"color":"red"});
			                   		$("#msgdiv").html(json.msg);  
			                   }			                   
		                	}
			            );
	                }
	            });
	        });
	    </script>
	</head>
	<body onload="loginform.username.focus()">
		<div class="container">
        <div class="login-box">
            <div class="hd">
                <h2>安全生产管理系统</h2>
            </div>
            <div class="bd">
                <form id="loginform" action="<%=request.getContextPath()%>/login.do" method="post">
                    <div class="form-group group" id="msgdiv" >                        
                    </div>
                    <div class="form-group group">
                        <label class="form-label form-label-name" for="username">用户名：</label>
                        <label for="username" class="placeholder">请输入用户名</label >
                        <input class="ipt ipt-name" type="text" tabindex="1" name="username" id="username"/>
                    </div>
                    <div class="form-group group">
                        <label class="form-label form-label-pwd" for="password">密码：</label>
                        <label for="password" class="placeholder">请输入密码</label>
                        <input class="ipt ipt-pwd" type="password" tabindex="2" name="password" id="password"/>
                    </div>
                    <div class="form-group group">
                        <label class="from-label-remember" for="remember"><input type="checkbox" tabindex="3" name="_spring_security_remember_me" id="_spring_security_remember_me"/> 让系统记住我</label>
                    </div>
                    <div class="form-group group"><button class="btn" type="submit" tabindex="4">登 录</button></div>
                </form>
            </div>
            <div class="ft">
                  <h2>西安智翔软件科技控股有限公司</h2>
            </div>
        </div>
        
    </div>
	</body>
</html>